//设备相关的接口函数放在这里
import request from "@/utils/request";
// 枚举定义接口地址
enum API {

  SELFDEVICE = "/terminal/", //获取设备的卡片基础数据
  STATISTICS = "/statistic/group/", //设备详情中数据统计的卡片数据
  // EXPORT = "/records/export",  //导出设备的视图数据
  LOGMESSAGE = "/logs/query",  //检索指定设备日志信息
  RECORDS = "/records/query",  //检索指定设备的检测记录
  CURRENT = "/prodbatch/current/",//根据模板编号查询生产批次信息
  HARDWARESTATUS = "/hardware/query",//根据查询参数获取指定设备硬件状态的时间窗口数据
  STATISTICSEARCH = "/records/counts",//获取设备的数据视图        统计检索
  LASTHARDWARE='/hardware/last/',
  DATIDENTIFIER='/records/details/',
  DETAILSGETIMGS='/records/images/'   // 根据dataIdentifier、terminalIdentity获取检测记录视图
}
//获取设备的卡片基础数据
export const reqSelfDevice = (terminalIdentity: any) => request.get<any, any>(API.SELFDEVICE + `${terminalIdentity}`);
//设备详情中数据统计的卡片数据
export const reqStatistic = (terminalIdentity: any,templateId:any) => request.get<any, any>(API.STATISTICS+`${terminalIdentity}/${templateId}`);
//导出设备的视图数据
// export const reqExport = (data: any) => request.post<any, any>(API.EXPORT, data);
//检索指定设备日志信息
export const reqLog = (data: any) => request.post<any, any>(API.LOGMESSAGE, data);
// 检索指定设备的检测记录
export const reqRecords = (data: any) => request.post<any, any>(API.RECORDS, data);
//根据模板编号查询生产批次信息
export const reqCurrent = (templateId: any) => request.get<any, any>(API.CURRENT + `${templateId}`);
//根据查询参数获取指定设备硬件状态的时间窗口数据
export const reqHardware = (data: any) => request.post<any, any>(API.HARDWARESTATUS, data);
//获取设备的数据视图        统计检索
export const reqStatisticSearch = (data: any) => request.post<any, any>(API.STATISTICSEARCH, data);
//根据终端标识符和检测书记表舒服获取检测记录的所有详细信息
export const reqDataIdentifier = (terminalIdentity: any,dataIdentifier:any) => request.post<any, any>(API.STATISTICSEARCH+`${terminalIdentity}/${dataIdentifier}`);
// 根据dataIdentifier、terminalIdentity获取检测记录视图
export const reqDetailsImg = (terminalIdentity: any,dataIdentifier:any) => request.post<any, any>(API.DETAILSGETIMGS+`${terminalIdentity}/${dataIdentifier}`);